<template>
  <div class="wechatManage">
    <el-tabs v-model="paneType" type="card" @tab-click="handleTabClick">
      <el-tab-pane label="自定义菜单" name="menu"></el-tab-pane>
      <el-tab-pane label="自动回复" name="reply"></el-tab-pane>
      <el-tab-pane label="粉丝管理" name="fans"></el-tab-pane>
      <el-tab-pane label="我的微博" name="myWeibo"></el-tab-pane>
      <!-- <el-tab-pane label="发布微博" name="sendWeibo"></el-tab-pane> -->
    </el-tabs>
    <weibo-menu v-if="paneType==='menu'"></weibo-menu>
    <weibo-reply v-else-if="paneType==='reply'"></weibo-reply>
    <weibo-fans v-else-if="paneType==='fans'"></weibo-fans>
    <weibo-list v-else-if="paneType==='myWeibo'"></weibo-list>
    <weibo-send v-else-if="paneType==='sendWeibo'"></weibo-send>
  </div>
</template>
<script>
  import {mapMutations} from 'vuex'
  import weiboMenu from './menu'
  import weiboFans from './fansList'
  import weiboReply from './autoReply/index'
  import weiboList from './myWeibo'
  import weiboSend from './sendWeibo'
  export default{
    components: {weiboMenu, weiboFans, weiboReply, weiboList, weiboSend},
    data () {
      return {
        paneType: this.$route.params.type
      }
    },
    destroyed () {
      this.SET_BREAD_TAIL('')
    },
    methods: {
      ...mapMutations(['SET_BREAD_TAIL']),
      handleTabClick () {
        this.$router.push({ name: 'WeiboManage', params: {type: this.paneType} })
      }
    }
  }
</script>
